<?php

class Reservations_AddInputView extends SrsReservationsBaseView
{
	public function executeHtml(AgaviRequestDataHolder $rd)
	{
		$this->setupHtml($rd);

		$referer = $rd->getHeader('REFERER', $this->genUrl('reservation.browse', array('hall' => $rd->getParameter('hall'))));

		$form = new AgaviParameterHolder(array(
			'reservation' => array(
				'date'      => $rd->getParameter('date', date('Y-m-d')),
				'from'      => $rd->getParameter('from', ''),
				'to'        => $rd->getParameter('to', ''),
				'lecturer'  => $this->user->getCurrentUser()->name,
			),
			'referer' => $referer,
		));

		$this->populate('addReservation', $form);
		
		$this->setAttribute('referer', $referer);
	}
}